const KoaRoter = require("@koa/router");

const loginRouter = new KoaRoter({ prefix: "/login" });

const LoginController = require("../controller/login.controller");

const { verifyLogin, verifyAuth } = require("../middleware/login.middleware");
/* 
*  判断用户和密码是否为空


* 查询用户是否存在

* 查询账号和密码是否一致

* 颁发令牌

*/
loginRouter.post("/", verifyLogin, LoginController.sign);
loginRouter.get("/test", verifyAuth, LoginController.test);

module.exports = loginRouter;
